<?php
    error_reporting(E_ALL); //DESENVOLVIMENTO
    define("POSTGRES_SERVER", "localhost");
    define("POSTGRES_USER", "postgres");
    define("POSTGRES_PASSWORD", "123456");
    define("POSTGRES_PORT", "5432");
    define("POSTGRES_DB", "TartarugaBolt");
    
    define('BASEDIR', '/TartarugaBolt/');
    define('BASEURL', 'http://localhost' . BASEDIR);
    define('CONTROLLERS', 'controllers/');
    define('VIEWS', 'views/');
    define('MODELS', 'models/');
    define('CLASSES', 'classes/');
    define('HELPERS', 'helpers/');
    
    function custom_autoload($file){
        
        if (file_exists(CLASSES . $file.'.class.php'))
            require_once CLASSES . $file.'.class.php';
        if (file_exists(CONTROLLERS . str_replace('Controller', '', $file).'.controller.php'))
            require_once CONTROLLERS . str_replace('Controller', '', $file).'.controller.php';
        if (file_exists(MODELS . str_replace('Model', '', $file).'.model.php'))
            require_once MODELS . str_replace('Model', '', $file).'.model.php';
        if (file_exists(HELPERS . str_replace('Helper', '', $file).'.helper.php'))
            require_once HELPERS . str_replace('Helper', '', $file).'.helper.php';
    }
    spl_autoload_register('custom_autoload')
?>
